1. Field of the Invention
The present disclosure relates to computer systems, and more particularly, to translating commands from a first human language to a second human language.
2. Description of the Related Art
In conventional technologies, computers use resource files. A resource generally corresponds to a pre-defined approach to a presentation of information, such as a typeface, computer icon, or a pre-defined format. Resource files are a way of enabling an application, based on resource definitions defined within the resource files, to tailor the appearance of an application without modifications in the application code. A resource could be, for example, a drop-down menu. The resource name that can be used to identify the resource could be “menu.”
The resource can have a corresponding index number. In some prior art systems, a resource file would contain an index number, but not the resource name itself. Instead, the index number corresponds to a given resource and hence, resource name. For instance, a resource name of “total amount” could have an index number of 35, and the resource name for a label of “shift” for a “shift” key could have an index number of 36.
Furthermore, each index has its own associated value as defined within the resource file. A value can be generally defined as a string or command that is used by a resource. For instance, in the coding of an application, whenever the index number “35” is used in an application, the application could then substitute the value (or string) “total amount.” However, “total amount” could have a value of “total amount” and the resource name of shift key could have a value of “shift.”
However, the use of indexes creates problems when trying to adapt an application for speakers other than English, as English is typically the source code computer language of choice. For instance, if one is trying to program a French interface, how does one translate, within a source file, the term “35” into a corresponding French value that is appropriate to a speaker of French? There are several approaches, each having its own disadvantages.
For instance, if words are indexed within a single source file for all languages, index numbers could run out. For instance, assume 1000 is used as a base address for English resources and 2000 for French resources, and the index increments by the count of one. Therefore, slots 1-1000 are for English, and slots 1001 to 2000 are for French. If there are more than 1000 resources of interest, then the source file can not contain a new resource, as either English or French resources can only have one thousand resources defined a piece.
A localized resource file can be generally defined as a resource file having values that correspond to local conditions, such as languages or cultures. If, instead of a base address within a single source file, the application has been programmed to access a selected one of a series of separate localized resource files as a function of a local language and culture, oftentimes there are discrepancies between the English meaning of the word and the foreign translation. For instance, for the index 36 (shift resource), index 36 could refer to a shift key, or alternatively to a group of employees working during a time period in a factory. Each meaning of the resource name “shift” would have a different translation as entered into the value within the localized resource file.
Therefore, in the prior art, instead of calling for an index number in an application, a resource name was called for instead. For instance, the resource name of “total.value” could be called for within an application. The resource file would then be used for defining what the corresponding value would be for the resource name. Then, the corresponding value could be defined as the English string “total value.” However, the corresponding value could instead be “kokonaismäärä” in Finnish, or it could be some other value in a foreign language. The use of resource names, however, made it somewhat easier for foreign translators to keep up with what is meant by an English term, as opposed to index numbers.
However, if a resource name was requested by an end user that was not defined within the selected resource file, the application would often hang up, crash, abort, or otherwise behave in an undesirable manner. Furthermore, for some kinds of applications, such as data driven applications, where customer independent code is developed in a generic way and all customer data is stored in application databases, the possibility of crashing is especially prevalent.
Furthermore, in certain applications, the name that a resource will be given, such as a name of a sensor used in a generic sensor display, is unknown during the time of writing the application. For instance, if a sensor named “moisture” is added to an application database, and the resource name of “moisture” is not defined within a resource file, the system would behave in an undesirable manner if the application tried to access the resource name “moisture”.
This is further exacerbated by resources that have resource names other than English. For instance, a resource is added to a system with a resource name of “lämpötila”. However, perhaps lämpötila is not defined in the resource file. This can be especially difficult when trying to develop culturally equivalent analogues for corresponding values for resource names, as it may be difficult to discover what is meant by this resource name.
Furthermore, having to manually (i.e., not in real-time, and by a developer) update resource files is a problem. Part of the problem is that there can be spelling mistakes when the resource names are entered independently in application code and in the resource file. In data driven applications especially, another part of the problem is that the number of required resource names could be increased after the application is already released. However, there may be no quick and convenient way to add these resource names to the resource file.
To support context sensitive translations of phrases and homonyms, there is a need for an application to identify the context, such as display name or application form, (in other words, the value), to be used in the translations. In a localization process for generating values for a local language that correspond to a resource name, the translations of the same phrases and homonyms should be available for parallel processing to reduce the localization effort and to improve the consistency of the translations. Therefore, there is a need for resource file management and localized resource file management.